<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
<!--    <link rel="stylesheet" type="text/css" th:href="@{css/test.css}"/>-->
    <script th:src="@{js/jquery-3.3.1.min.js}"></script>
</head>
<body>
    <form>
        <label>邮箱账号：</label>
        <input id="email" type="text" th:placeholder="请输入邮箱" name="email"/>
    </form>
    [[${code == null ? "没有数据" : code}]]
    <a  href="javascript:send();"  id="sendEmail" >发送邮件</a>
    <form action="file_upload" method="post" enctype="multipart/form-data">
        <input type="file" name="file"/>
        <input type="submit"/>
    </form>
</body>
<script>
    function f1() {
        alert("111")
    }

    function send(){
        $.ajax({
            url:'/customer/email',
            type: "POST",
            async:false,
            data: {
                "email":$("#email").val()
            },
            success: function(data) {
                //do sth...
                // layer.msg(JSON.stringify(data));
                // console.log(data);
                // window.location.reload();
                //alert(data);
                // $("#sendEmail").valueOf("已发送")
            }
        });
    }
</script>
</html>